package com.gzedu.module.faced.meun.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.gzedu.common.util.page.Page;
import com.gzedu.module.faced.meun.MeunFacade;
import com.gzedu.module.modle.meun.Meun;
import com.gzedu.module.service.meun.IMeunService;

@Component
public class MeunFacadeImpl implements MeunFacade{
	
	@Autowired
	private IMeunService meunService;

	public boolean insert(Meun meun) {
		// TODO Auto-generated method stub
		int result = this.meunService.insert(meun);
		if(result == 1){
			return true;
		}else{
			return false;
		}
	}

	public boolean batchInsert(List<Meun> data) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean replace(Meun meun) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean batchReplace(List<Meun> data) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean update(Meun meun, Map<String, Object> conditions) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean updateById(Meun meun) {
		// TODO Auto-generated method stub
		return false;
	}

	public Meun getOne(Map<String, Object> conditions, int offset) {
		// TODO Auto-generated method stub
		return null;
	}

	public Meun getOne(Map<String, Object> conditions) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Meun> select(Map<String, Object> conditions, int offset, int size) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Meun> select(Map<String, Object> conditions, int size) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Meun> select(Map<String, Object> conditions) {
		// TODO Auto-generated method stub
		return null;
	}

	public Page<Meun> page(Map<String, Object> conditions, int page, int pagesize) {
		// TODO Auto-generated method stub
		return null;
	}

	public Meun getById(String id) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<Meun> getAll() {
		// TODO Auto-generated method stub
		return null;
	}

	public int count(Map<String, Object> conditions) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int delete(Map<String, Object> conditions) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int deleteByPrimary(long primary) {
		// TODO Auto-generated method stub
		return 0;
	}

	public int clear() {
		// TODO Auto-generated method stub
		return 0;
	}

	public Meun getMeun() {
		// TODO Auto-generated method stub
		Meun m = meunService.getById("27ecbe6fac7048b6a683036b757213d0");
		
		List<Meun> res = meunService.findAllList();
		
		Meun meun = meunService.getAllChildren(m, res);
		
		return meun;
	}
	
	public Meun getMeunByRole(String roleCode){
		Meun m = meunService.getById("27ecbe6fac7048b6a683036b757213d0");
		
		List<Meun> res = meunService.findByRoleCode(roleCode);
		
		Meun meun = meunService.getAllChildren(m, res);
		
		return meun;
	}

	public List<Meun> findByRoleCode(String roleCode) {
		// TODO Auto-generated method stub
		return meunService.findByRoleCode(roleCode);
	}


}
